#pragma once
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
const char *filename = "/dev/pts/8";

class RedirTermial
{
public:
    void operator()()
    {
        
        int fd = open(filename, O_WRONLY);
        if (fd < 0)
        {
            printf("redir error!!\n");
        }
       int n= dup2(fd, 2);
       if(n<0)printf("dup2 error!!");
      // printf("dup2 success!!");
    }
};